<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="../css/shop.style.css" rel="stylesheet" />
</head>
<body>
	<table>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<table cellpadding="10" cellspacing="0">
					<tr bgcolor="lightblue">
						<td>사진</td>
						<td>상품이름</td>
						<td>단가</td>
						<td>주문수량</td>
						<td>총액</td>
					</tr>
					<c:set var="sum" />
					<c:forEach var="product" items="${list}" varStatus="s">
						<tr>
							<td><img src="../images/${product.prodImage}" width="150" height="150"></td>
							<td>${product.prodName}</td>
							<td><fmt:formatNumber value="${product.prodOutPrice}" pattern="###,###,###" />원</td>
							<td><fmt:formatNumber value="${quantityList[s.index]}" pattern="###,###,###" />개</td>
							<td><fmt:formatNumber value="${product.prodOutPrice*quantityList[s.index]}" pattern="###,###,###" />원</td>
						</tr>
						<tr>
							<td colspan="5">
								<hr>
							</td>
						</tr>
						<c:set var="sum" value="${sum+product.prodOutPrice*quantityList[s.index]}" />
					</c:forEach>
					<tr>
						<td colspan="5" align="right">합계 : <fmt:formatNumber value="${sum}" pattern="###,###,###" /> 원
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>